package luj.tool.jnproxyan.proxy.admin.http.handle.invoke;

import luj.cluster.api.actor.Tellable;
import luj.tool.jnproxyan.framework.proxy.actor.tell.ActorTeller;
import luj.tool.jnproxyan.proxy.admin.AdminHttpHandler;

import java.util.function.BiFunction;

final class ActorRefImpl implements AdminHttpHandler.Ref {

  @Override
  public <M> void tell(Class<M> type, BiFunction<ActorTeller.MBean, M, ActorTeller.MBean> msg) {
    //TODO: 暂时直传，后面换成ForwardMsg
    _teller.inject(_adminRef).tell(type, msg);
  }

  @Override
  public void tell(Object msg) {
    //TODO: 暂时直传，后面换成ForwardMsg
    _adminRef.tell(msg);
  }

  Tellable _adminRef;
  ActorTeller _teller;

  Class<?> _targetActor;
}
